package com.fw.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Permission extends Model<Permission>{
	private static final long serialVersionUID = 1L;
	public static final Permission permissonDao = new Permission();
	public Permission getParentPermission(){
		String sql = "select * from permission p where p.p_id = ?";
		List<Permission> ps = permissonDao.find(sql, getInt("parent_id"));
		if(ps.size()>0) return ps.get(0);
		return null;
	}
}
